home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-05-19 | 6.0 KB | 210 lines | [TEXT/MPS ] |
- {
- File: LocationManager.p
-
- Contains: LocationManager (manange preferences for different physical locations)
-
- Version: System 7.6
- Package: Location Manager SDK 1.0
-
- Copyright: © 1984-1997 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs@apple.com
-
- }
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes := 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT LocationManager;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED __LOCATIONMANAGER__}
- {$SETC __LOCATIONMANAGER__ := 1}
-
- {$I+}
- {$SETC LocationManagerIncludes := UsingIncludes}
- {$SETC UsingIncludes := 1}
-
- {$IFC UNDEFINED __APPLEEVENTS__}
- {$I AppleEvents.p}
- {$ENDC}
- {$IFC UNDEFINED __COMPONENTS__}
- {$I Components.p}
- {$ENDC}
- {$IFC UNDEFINED __PROCESSES__}
- {$I Processes.p}
- {$ENDC}
- {$IFC UNDEFINED __DIALOGS__}
- {$I Dialogs.p}
- {$ENDC}
-
- {$PUSH}
- {$ALIGN MAC68K}
- {$LibExport+}
-
- {
- --------------------------------------------------------------------------------------
- Location token
- --------------------------------------------------------------------------------------
- }
-
- TYPE
- ALMToken = ^LONGINT;
- {
- --------------------------------------------------------------------------------------
- Public error codes
- --------------------------------------------------------------------------------------
- }
-
- CONST
- ALMInternalErr = -30049;
- ALMLocationNotFound = -30048;
- ALMNoSuchModuleErr = -30047;
- ALMModuleCommunicationErr = -30046;
- ALMDuplicateModuleErr = -30045;
- ALMInstallationErr = -30044;
- ALMDeferSwitchErr = -30043;
- ALMLastErr = -30043;
- ALMLastAllocatedErrNum = -30030;
-
- {
- --------------------------------------------------------------------------------------
- Various parameters
- --------------------------------------------------------------------------------------
- }
- { ALMConfirmName reports these results }
- ALMConfirmRenameConfig = 1;
- ALMConfirmReplaceConfig = 2;
-
- { ALMSwitchToLocation masks }
- kALMDefaultSwitchFlags = 0;
- kALMDontShowStatusWindow = 1;
- kALMSignalViaAE = 2;
-
- kALMLocationNameMaxLen = 31;
- kALMMaxLocations = 16; { arbitrary limit. enforced by LocatioManager. }
- kALMNoLocationIndex = -1; { index and token for the 'off' location }
- kALMNoLocationToken = -1;
- kAELocationNotice = 'walk'; { Notification AEvent sent to apps when location changes }
- kALMFileCreator = 'walk'; { creator type of LocatioManager files }
-
- { gestalt selectors }
- gestaltALMVers = 'walk';
- gestaltALMAttr = 'trip';
- gestaltALMPresent = 0;
-
- {
- --------------------------------------------------------------------------------------
- Location-switched notification proc
- --------------------------------------------------------------------------------------
- }
-
- TYPE
- ALMNotificationProcPtr = ProcPtr; { PROCEDURE ALMNotification(VAR theEvent: AppleEvent); }
-
- ALMNotificationUPP = UniversalProcPtr;
-
- CONST
- uppALMNotificationProcInfo = $000000C0;
-
- FUNCTION NewALMNotificationProc(userRoutine: ALMNotificationProcPtr): ALMNotificationUPP;
- {$IFC NOT GENERATINGCFM }
- INLINE $2E9F;
- {$ENDC}
-
- PROCEDURE CallALMNotificationProc(VAR theEvent: AppleEvent; userRoutine: ALMNotificationUPP);
- {$IFC NOT GENERATINGCFM}
- INLINE $205F, $4E90;
- {$ENDC}
- {
- --------------------------------------------------------------------------------------
- Dispatched trap API
- --------------------------------------------------------------------------------------
- }
- FUNCTION ALMGetCurrentLocation(VAR index: SInt16; VAR token: ALMToken; VAR name: Str31): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0600, $AAA4;
- {$ENDC}
- FUNCTION ALMGetIndLocation(index: SInt16; VAR token: ALMToken; VAR name: Str31): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0501, $AAA4;
- {$ENDC}
- FUNCTION ALMCountLocations(VAR nLocations: SInt16): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0202, $AAA4;
- {$ENDC}
- FUNCTION ALMSwitchToLocation(newLocation: ALMToken; switchFlags: SInt32): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0403, $AAA4;
- {$ENDC}
- FUNCTION ALMRegisterNotifyProc(notificationProc: ALMNotificationUPP; {CONST}VAR whichPSN: ProcessSerialNumber): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0404, $AAA4;
- {$ENDC}
- FUNCTION ALMRemoveNotifyProc(notificationProc: ALMNotificationUPP; {CONST}VAR whichPSN: ProcessSerialNumber): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0405, $AAA4;
- {$ENDC}
- FUNCTION ALMConfirmName(msg: ConstStr255Param; VAR configName: Str255; VAR choice: SInt16; filter: ModalFilterUPP): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0806, $AAA4;
- {$ENDC}
- {
- --------------------------------------------------------------------------------------
- Location Manager User Module API
- --------------------------------------------------------------------------------------
- }
-
- CONST
- kALMComponentType = 'walk'; { These masks apply to the "flags" field in the ComponentDescription record. }
- kALMMultiplePerLocation = 1; { this module can be added more than once to a location }
- { this module's settings' descriptions can change even }
- kALMDescriptionGetsStale = 2; { when the setting didn't change. }
-
-
- TYPE
- ALMComponentFlagsEnum = UInt32;
- ALMRebootFlags = UInt32;
-
- CONST
- { These are the possible values of ALMRebootFlags to be returned in the 'flags' parameter of ALMSetCurrent() }
- kALMNoChange = 0;
- kALMAvailableNow = 1;
- kALMFinderRestart = 2;
- kALMProcesses = 3;
- kALMExtensions = 4;
- kALMWarmBoot = 5;
- kALMColdBoot = 6;
- kALMShutdown = 7;
-
- kALMScriptInfoVersion = 2;
-
-
- TYPE
- ALMScriptMgrInfoPtr = ^ALMScriptMgrInfo;
- ALMScriptMgrInfo = RECORD
- version: SInt16; { set to kALMScriptInfoVersion }
- scriptCode: SInt16;
- regionCode: SInt16;
- langCode: SInt16;
- fontNum: SInt16;
- fontSize: SInt16;
- END;
-
- {$ALIGN RESET}
- {$POP}
-
- {$SETC UsingIncludes := LocationManagerIncludes}
-
- {$ENDC} {__LOCATIONMANAGER__}
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
-